<?php

/**
 * Gallery form.
 *
 * @package    jobeet
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class GalleryForm extends BaseGalleryForm
{
  public function configure()
  {
      unset($this->widgetSchema['create_time']);
      unset($this->widgetSchema['update_time']);
      $this->widgetSchema['content'] =  new sfWidgetFormTextareaTinyMCE(array(), array('rows' => '20', 'cols' => '100'));
      $this->widgetSchema['photo'] = new sfWidgetFormInputFileEditable(array(
        'label' => 'Zdjęcie do galerii',
        'file_src'  => sfConfig::get('sf_upload_dir').'/images',
        'is_image'  => true,
        'edit_mode' => !$this->isNew(),
        'template'  => '<div>%file%<br />%input%<br />%delete% %delete_label%</div>'
      ));
      $this->validatorSchema['photo'] = new sfValidatorFile(array(
        'required'   => true,
        'path'       => sfConfig::get('sf_upload_dir').'/images',
        'mime_types' => 'web_images',
      ));
  }
}
